﻿///Name:UserWebRelationAccess类
///Author: 张仪
///Description: 
///Company:河南企汇网信息技术有限公司
///DateTime:2012/6/19 19:21:28


using System;
using System.Data;
using Model.Data;
using Model;
using DataAccess;
using BusinessLogic.BusinessRules;


namespace BusinessLogic.ClassFactory
{
	/// <summary>
	/// UserWebRelationFactory 的摘要说明。
	/// </summary>
	public class UserWebRelationFactory:BaseFactory
	{
		public UserWebRelationFactory() :base()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public UserWebRelationFactory(DBManager  l_DBManager):base(l_DBManager)
		{
		}
		public UserWebRelation NewInstance()
		{
			UserWebRelationAccess l_Access = new UserWebRelationAccess(m_Manager);
			UserWebRelation objUserWebRelation=new UserWebRelation(this.m_Manager,l_Access);			
			objUserWebRelation.NewDataSet();
			objUserWebRelation.SelectRow(0);
			return objUserWebRelation;
		}		

		public UserWebRelation CreatorBySql(string Sql)
		{
			UserWebRelationAccess l_Access = new UserWebRelationAccess(m_Manager);
			UserWebRelation objUserWebRelation=new UserWebRelation(this.m_Manager,l_Access);			
			DataSet l_ds=new UserWebRelationData();
			if(l_Access.QueryBySql(ref l_ds,Sql)<1)
			{
				return  null ;
			}
			objUserWebRelation.SetDataSet(l_ds);
			objUserWebRelation.SelectRow(0);
			return objUserWebRelation;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="intUserWebRelationID"></param>
		/// <returns></returns>
		public UserWebRelation Creator(int intUserWebRelationID)
		{
			UserWebRelationAccess l_Access = new UserWebRelationAccess(m_Manager);
			UserWebRelation objUserWebRelation=new UserWebRelation(this.m_Manager,l_Access);			
			DataSet l_ds=new UserWebRelationData();
			if(l_Access.QueryByID(ref l_ds,intUserWebRelationID)<1)
			{
				return null ;
			}
			objUserWebRelation.SetDataSet(l_ds);
			objUserWebRelation.SelectRow(0);
			return objUserWebRelation;
		}

		public UserWebRelation Creator()
		{
			UserWebRelationAccess l_Access = new UserWebRelationAccess(m_Manager);
			UserWebRelation objUserWebRelation=new UserWebRelation(this.m_Manager,l_Access);			
			DataSet l_ds=new UserWebRelationData();
			if(l_Access.QueryAll(ref l_ds)<1)
			{
				return null ;
				
			}
			objUserWebRelation.SetDataSet(l_ds);
			objUserWebRelation.SelectRow(0);
			return objUserWebRelation;
		}
		
	}
}
